package com.dzx.currentency.publish;

/**
 * @author DuanZhaoXu
 * @ClassName:
 * @Description:
 * @date 2018年11月19日 13:56:27
 */

/**
 * static 静态块的饿汉模式
 */
public class SingletonExample6 {
    private  SingletonExample6(){}

    private static SingletonExample6 instance =null;

    static  {
        instance = new SingletonExample6();
    }

    private  static  SingletonExample6 getInstance(){
        return instance;
    }
    
    public static void  main(String[] args){
        System.out.println(getInstance());
        System.out.println(getInstance());
    }
}
